﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace SPPivotViewer.HttpHandler
{
    public static class SPHandlerHelper
    {
        public static string GetUrlFileBody(Uri url)
        {
            string[] pathSegments = url.Segments;
            string fileName = pathSegments[pathSegments.Length - 1];

            //Chop off the extension
            string fileBody = fileName.Substring(0, fileName.LastIndexOf('.'));
            fileBody=HttpContext.Current.Server.UrlDecode(fileBody);
            return fileBody;
        }
    }
}
